<?php
$lang_path="";
$config_lang="english";
$posttext="";
$define_links='0';
$link_new_account = 'index.php?option=registration&amp;task=register';
$link_lost_password = 'index.php?option=registration&amp;task=lostPassword';
		
// load language file
$basePath = dirname(__file__);
$lang_path = $basePath . '/login_languages/' . $config_lang .'.php';
$lang_path_default = $basePath . '/login_languages/english.php';

if (file_exists($lang_path)) {
    require_once ($lang_path);
} else {
    require_once ($lang_path_default);
}
?>
<script type="text/javascript">
	function checkMail(x){
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(x)){ document.loginForm.submit(); }
		else{ alert('\nInvalid entry!\nYou must enter a valid email address format "name@domain.dom".'); return false; }
	}
</script>
<style type="text/css">
#main {
	position:relative;
	min-height:450px!important;
	_height:450px;
}

html>body #main {
	height: auto;
	min-height: 450px;
}
</style>
<div align="center">
  <div class="mod_login" align="center">
  	<div class="mod_login_content_body">
      <form action="<?php echo $_SERVER["SCRIPT_NAME"];?>" method="post" name="loginForm">
        <table width="100%" border="0" align="center" cellspacing="5" cellpadding="5">
          <tr>
            <td align="center" width="100">
			<img src="img/logo_users.jpg" alt="users babili" />
			</td>
			<td>
			<table cellspacing="15"><tr><td for="mod_login_username" class="mod_login_label_username" align="right"><?php echo _EMAIL; ?></td><td>
              <input type="text" name="username" id="mod_login_username" class="inputbox" alt="username" size="20" />
              </td></tr><tr><td for="mod_login_password" class="mod_login_label_password" align="right"><?php echo _PASSWORD; ?></td><td>
              <input type="password" id="mod_login_password" name="passwd" class="inputbox" size="20" alt="password" />
              </td></tr><tr><td for="mod_login_project" align="right"><?php echo _PROJECT; ?>
              </td><td>
			  <select id="project" name="project">
			  <?php $selectProjects1 =$db->select()->from('projets',array('*'))->where('projets.status=1');
					$db->setFetchMode(Zend_Db::FETCH_OBJ);
					$resultProjects1 = $db->fetchAll($selectProjects1);
					foreach($resultProjects1 as $project)
						echo "<option value=\"".$project->id_projet."\" >".$project->name."</option>";
				?>
			  </select>
              </td></tr></table>
		 </td><tr><td class="mod_login_form_submit" align="center" colspan="2">              
			 <input type="submit" name="Submit" onclick="javascript: if(checkMail(document.loginForm.username.value)==true)return true; else return false;" class="mod_login_submit_button" title="<?php echo _BUTTON_LOGIN; ?>" value="Login" style="width:70px; padding-left:30px;" />
		 </td>
        </tr>
      </table>
 
      <input type="hidden" name="lang" value="<?php echo $config_lang; ?>" />
      <input type="hidden" name="<?php echo $validate; ?>" value="1" />
    </form>
	<ul class="auth">
		<li>Never logged in to babili yet ? Simply create a babili account by entering your email and setting the password you want in the Login fields. Your account will automatically be created.</li>
	
		<li>Forgot your password? Simply put your email and leave the password field empty. Click Login and your password will be sent to you by email. A valid email is therefore required.</li>
	
		<li>Before or while you translate, we strongly recommend you to read first Talend&#39;s <a href="http://www.talendforge.org/wiki/doku.php?id=babili" title="Talend Guidelines" target="_blank">guidelines</a> and if you still have questions or need help about translation, then come to us on the dedicated Babili Forum: <a href="http://www.talendforge.org/forum/viewforum.php?id=17" target="_blank" title="Talend Guidelines">http://www.talendforge.org/forum/viewforum.php?id=17</a></li>
	</ul>
	
  </div>
 </div>
</div>